package org.chameleon.monitor;

/**
 * thread pool运行的状态
 */
public class ThreadPoolState implements MonitorData {


    private String poolName;

    private int corePoolSize;

    private int maximumPoolSize;

    private String queueType;

    private int queueCapacity;

    /**
     * 队列任务数量
     */
    private int queueSize;

    /**
     * SynchronousQueue队列模式
     */
    private boolean fair;

    /**
     * 队列剩余容量
     */
    private int queueRemainingCapacity;

    /**
     * 正在执行任务的活跃线程大致总数
     */
    private int activeCount;

    /**
     * 大致任务总数
     */
    private long taskCount;

    /**
     * 已执行完成的大致任务总数
     */
    private long completedTaskCount;

    /**
     * 池中曾经同时存在的最大线程数量
     */
    private int largestPoolSize;

    /**
     * 当前池中存在的线程总数
     */
    private int poolSize;

    /**
     * 等待执行的任务数量
     */
    private int waitTaskCount;

    /**
     * 拒绝的任务数量
     */
    private int rejectCount;

    /**
     * 拒绝策略名称
     */
    private String rejectHandlerName;

    /**
     * 是否是动态Executor线程池
     */
    private boolean dynamic;

    /**
     * 执行超时任务数量
     */
    private int runTimeoutCount;

    /**
     * 在队列等待超时任务数量
     */
    private int queueTimeoutCount;


    public String getPoolName() {
        return poolName;
    }

    public ThreadPoolState setPoolName(String poolName) {
        this.poolName = poolName;
        return this;
    }

    public int getCorePoolSize() {
        return corePoolSize;
    }

    public ThreadPoolState setCorePoolSize(int corePoolSize) {
        this.corePoolSize = corePoolSize;
        return this;
    }

    public int getMaximumPoolSize() {
        return maximumPoolSize;
    }

    public ThreadPoolState setMaximumPoolSize(int maximumPoolSize) {
        this.maximumPoolSize = maximumPoolSize;
        return this;
    }

    public String getQueueType() {
        return queueType;
    }

    public ThreadPoolState setQueueType(String queueType) {
        this.queueType = queueType;
        return this;
    }

    public int getQueueCapacity() {
        return queueCapacity;
    }

    public ThreadPoolState setQueueCapacity(int queueCapacity) {
        this.queueCapacity = queueCapacity;
        return this;
    }

    public int getQueueSize() {
        return queueSize;
    }

    public ThreadPoolState setQueueSize(int queueSize) {
        this.queueSize = queueSize;
        return this;
    }

    public boolean isFair() {
        return fair;
    }

    public ThreadPoolState setFair(boolean fair) {
        this.fair = fair;
        return this;
    }

    public int getQueueRemainingCapacity() {
        return queueRemainingCapacity;
    }

    public ThreadPoolState setQueueRemainingCapacity(int queueRemainingCapacity) {
        this.queueRemainingCapacity = queueRemainingCapacity;
        return this;
    }

    public int getActiveCount() {
        return activeCount;
    }

    public ThreadPoolState setActiveCount(int activeCount) {
        this.activeCount = activeCount;
        return this;
    }

    public long getTaskCount() {
        return taskCount;
    }

    public ThreadPoolState setTaskCount(long taskCount) {
        this.taskCount = taskCount;
        return this;
    }

    public long getCompletedTaskCount() {
        return completedTaskCount;
    }

    public ThreadPoolState setCompletedTaskCount(long completedTaskCount) {
        this.completedTaskCount = completedTaskCount;
        return this;
    }

    public int getLargestPoolSize() {
        return largestPoolSize;
    }

    public ThreadPoolState setLargestPoolSize(int largestPoolSize) {
        this.largestPoolSize = largestPoolSize;
        return this;
    }

    public int getPoolSize() {
        return poolSize;
    }

    public ThreadPoolState setPoolSize(int poolSize) {
        this.poolSize = poolSize;
        return this;
    }

    public int getWaitTaskCount() {
        return waitTaskCount;
    }

    public ThreadPoolState setWaitTaskCount(int waitTaskCount) {
        this.waitTaskCount = waitTaskCount;
        return this;
    }

    public int getRejectCount() {
        return rejectCount;
    }

    public ThreadPoolState setRejectCount(int rejectCount) {
        this.rejectCount = rejectCount;
        return this;
    }

    public String getRejectHandlerName() {
        return rejectHandlerName;
    }

    public ThreadPoolState setRejectHandlerName(String rejectHandlerName) {
        this.rejectHandlerName = rejectHandlerName;
        return this;
    }

    public boolean isDynamic() {
        return dynamic;
    }

    public ThreadPoolState setDynamic(boolean dynamic) {
        this.dynamic = dynamic;
        return this;
    }

    public int getRunTimeoutCount() {
        return runTimeoutCount;
    }

    public ThreadPoolState setRunTimeoutCount(int runTimeoutCount) {
        this.runTimeoutCount = runTimeoutCount;
        return this;
    }

    public int getQueueTimeoutCount() {
        return queueTimeoutCount;
    }

    public ThreadPoolState setQueueTimeoutCount(int queueTimeoutCount) {
        this.queueTimeoutCount = queueTimeoutCount;
        return this;
    }

}
